Think C 4.0 (TC) is an extension of the C programming language to support object-oriented programming (OOP). C++ carries this extension further, at the expense of simplicity. This chapter provides sample TC programs which emphasize the OOP approach. We will first define a few OOP terms and their use in TC.
An OBJECT is a data structure combined - or ENCAPSULATED - with the procedures which will act upon this data. The organization of this object is the object's CLASS, or the type of the object. That is, a class definition lists the INSTANCE VARIABLES (data) which are contained in all objects of this type, as well as the METHODS (procedures), acting upon the data. In TC, the definition for the 'Person' class may look like: